import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login')
  },
  {
    path: '/plogin',
    name: 'plogin',
    component: () => import('@/views/login/plogin')
  },
  {
    path: '/deng',
    name: 'deng',
    component: () => import('@/views/login/deng')
  },
  {
    path: '/',
    component: () => import('@/views/layout'),
    children: [
      {
        path: '',
        name: 'home',
        component: () => import('@/views/home')
      },
      {
        path: '/class',
        name: 'class',
        component: () => import('@/views/class')
      },
      {
        path: '/question',
        name: 'question',
        component: () => import('@/views/question')
      },
      {
        path: '/user',
        name: 'user',
        component: () => import('@/views/user')
      }
    ]
  },
  {
    path: '/detail/:id',
    name: 'detail',
    component: () => import('@/views/class/detail')
  },
  {
    path: '/myDetail/:id',
    name: 'myDetail',
    component: () => import('@/views/class/myDetail')
  },
  {
    path: '/practive/:id1/:id2',
    name: 'practive',
    component: () => import('@/views/question/practive')
  },
  {
    path: '/exem',
    name: 'exem',
    component: () => import('@/views/question/exem')
  },
  {
    path: '/exercise',
    name: 'exercise',
    component: () => import('@/views/question/exercise')
  },
  {
    path: '/exemDetail/:id',
    name: 'exemDetail',
    component: () => import('@/views/question/exemDetail')
  },
  {
    path: '/myquestion',
    name: 'myquestion',
    component: () => import('@/views/user/myquestion')
  },
  {
    path: '/service',
    name: 'service',
    component: () => import('@/views/user/service')
  },
  {
    path: '/history',
    name: 'history',
    component: () => import('@/views/user/history')
  },
  {
    path: '/redact',
    name: 'redact',
    component: () => import('@/views/user/redact')
  },
  {
    path: '/exemStudy/:id',
    name: 'exemStudy',
    component: () => import('@/views/user/exemStudy')
  },
  {
    path: '/message',
    name: 'message',
    component: () => import('@/views/user/message')
  },
  {
    path: '/record',
    name: 'record',
    component: () => import('@/views/user/record')
  },
  {
    path: '/study/:id',
    name: 'study',
    component: () => import('@/views/user/study')
  }
]

const router = new VueRouter({
  routes
})

export default router
